package com.hp.gxw.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author huangping
 * @since 2024-02-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class CostCountCompleted implements Serializable {

    private static final long serialVersionUID=1L;

    private Long id;

    /**
     * 销售订单号
     */
    private String saleOrder;

    /**
     * 客户编码
     */
    private String customerCode;

    /**
     * 客户名称
     */
    private String customerName;

    /**
     * 随工单号
     */
    private String workOrder;

    /**
     * 产品编码
     */
    private String cinvcode;

    /**
     * 产品名称
     */
    private String cinvname;

    /**
     * 工序编码
     */
    private String processCode;

    /**
     * 工序名称
     */
    private String processName;

    /**
     * 成本对象
     */
    private String elementCode;

    /**
     * 成本对象名称
     */
    private String elementName;

    /**
     * 金额
     */
    private BigDecimal amount;

    /**
     * 加工数量
     */
    private BigDecimal qty;

    /**
     * 计算人
     */
    private Long createUser;

    /**
     * 计算时间
     */
    private Date createTime;

    public static CostCountCompleted instance(CostCountTemp temp){
        CostCountCompleted completed = new CostCountCompleted();
        completed.setSaleOrder(temp.getSaleOrder());
        completed.setCustomerCode(temp.getCustomerCode());
        completed.setCustomerName(temp.getCustomerName());
        completed.setWorkOrder(temp.getWorkOrder());
        completed.setCinvcode(temp.getCinvcode());
        completed.setCinvname(temp.getCinvname());
        completed.setProcessCode(temp.getProcessCode());
        completed.setProcessName(temp.getProcessName());
        completed.setQty(temp.getQty());
        return completed;
    }
}
